package com.smsc.headend.task.engine.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smsc.headend.module.fwu.entity.DeviceFirmwareVersion;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

/**
 * @author qinbin
 * @date 2021/4/28
 * @vison v1.0
 */
public interface DeviceFirmwareVersionMapper extends BaseMapper<DeviceFirmwareVersion> {

    @Select("SELECT DEVICE_ID,DEVICE_TYPE,FW_TYPE,FW_VERSION FROM M_DEVICE_FIRMWARE_VERSION WHERE 1=1 " +
            "AND DEVICE_ID = #{deviceId} AND DEVICE_TYPE = #{deviceType} AND FW_TYPE = #{fwType}")
    @ResultType(DeviceFirmwareVersion.class)
    DeviceFirmwareVersion getFwVersion(@Param("deviceId") Long deviceId, @Param("deviceType") Long deviceType,
                                        @Param("fwType") Long fwType);
}
